<?php

namespace App\Listeners;

use App\Events\PostSaved;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Support\Facades\Log;

class SaveDataToCache
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param PostSaved $event
     * @return void
     */
    public function handle(PostSaved $event)
    {
        //
//        dd($event);
        $post = $event->post;


        Log::info('保存文章到缓存成功！', ['id' => $post['id'], 'title' => $post['title']]);
    }
}
